<template>
  <div>
    <div class="top" v-if="router !== 'login' && router !== 'regist'">
      <div class="ab w yy">
        <!-- logo区域 -->
        <div class="logohezi">
          献血服务
          <!-- <a href="/"><i class="logo"></i></a> -->
        </div>
        <!-- 首页nav -->
        <div class="nav">
          <ul>
            <li>
              <router-link
                to="/home"
                :class="{ c: this.$route.path === '/home' }"
                >首页</router-link
              >
            </li>
            <li>
              <router-link
                to="/news"
                :class="{ c: this.$route.path === '/news' }"
                >新闻中心</router-link
              >
            </li>
            <li>
              <router-link
                to="/knowledge"
                :class="{ c: this.$route.path === '/knowledge' }"
                >献血知识</router-link
              >
            </li>
            <li>
              <router-link
                to="/square"
                :class="{ c: this.$route.path === '/square' }"
                >用血报销</router-link
              >
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "YHeader",
  data() {
    return {
      userInfo: {},
      userType: '1',
      router: ''
    }
  },
  methods: {
    toCenter() {
      this.$router.push('/center')
    },
    search() {
      alert(this.keywords)
    },
    toLogin() {
      this.$router.push('/login')
    },
    choose(v) {
      if (v === 'login') {
        localStorage.removeItem('meiyaWebInfo')
      }
      this.$router.push(`/${v}`)
    }
  },
};
</script>

<style lang="scss" scoped>
/* 导航首页 */

.nav {
  float: left;
  margin-left: 30px;
  line-height: 51px;
}

.nav ul li a:link {
  color: #ffffff;
}

.nav a:hover {
  color: #00d7c6;
}

.nav ul li {
  float: left;
  margin: 0 14px;
  font-size: 14px;
}
// .nav ul li a .c {
//   color: #00d7c6;
// }
.nav ul li .c {
  color: #00d7c6 !important;
}
.avator {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}
.flex-center {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logohezi {
  font-size: 20px;
  color: #ffffff;
  line-height: 40px;
}
</style>
